A smart mobile phone consumes significant power, and a kernel in the existing smart mobile phone is provided with a mechanism to adjusting the frequency of a Central Processing Unit (CPU) for lower power consumption.
Specifically, the adjusting mechanism is performed during startup in a “Performance” mode in which the CPU operates at the highest level frequency to improve a startup response speed and ensure optimal performance. When the smart mobile phone is enabled fully, the adjusting mechanism is performed in an “On Demand” mode in which if there is an input event, then the frequency of the CPU is adjusted by an input handler instance, and if there is no input event, the frequency of the CPU is adjusted according to a load of the CPU.
In the On Demand mode, all of input devices will be registered with an input handler instance. Each time there is an input device reporting an input event to an input handler, the kernel will adjust the frequency of the CPU to the highest level. If there is no input event, then the frequency of the CPU will be lowered gradually according to a load condition of the CPU.
When the smart mobile phone is in an operating mode, an input device will report an input event frequently, and the frequency of the CPU will be adjusted to the highest level each time an input event is reported. Thus in the On Demand mode, the CPU may operate at a high frequency for a long period of time, thus resulting in remaining high power consumption of the smart mobile phone.